package 传智播客_黑马.java高级.reflect反射;



import java.lang.reflect.Method;

@SuppressWarnings("all")
public class Test {

    public static void main(String[] args) throws Exception {
        Class<Person> personClass = Person.class;
        Person person = new Person();
        Method sleep = personClass.getMethod("sleep", int.class);
        sleep.invoke(person, 5);
    }
}

